package com.example.e_comm.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;

@Data
@TableName("roles")
@NoArgsConstructor
@AllArgsConstructor
public class Role {
    @TableId(type =IdType.AUTO)
    private Long id;
    private String name;//角色名
    private String description;//描述

    @TableField(value = "role_key")
    private String roleKey;
    private Integer status;

    @TableLogic(value = "0", delval = "1")
    private Integer deleted;

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private List<Permission> permissions;
}